package com.lagou.pojo;

/**
 * @author: wudong
 * @create: 2021-05-19 10:35
 **/
public enum SqlCommandType {

    INSERT("insert","新增"),
    UPDATE("update","更新"),
    DELETE("delete","删除"),
    SELECT("select","查询");

    private String value;

    private String desc;

    private static final SqlCommandType[] VALUES = SqlCommandType.values();

    SqlCommandType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static SqlCommandType of(String value) {
        for (SqlCommandType item : VALUES) {
            if (item.value.equals(value)) {
                return item;
            }
        }
        return null;
    }
}
